<template>
  <div class="product-setup">
    <el-row>
      <el-form ref="form" :model="setupForm" :rules="setupRules" label-width="110px">
        <el-col :span="8">
          <el-form-item label="商品详情：">
            <el-input-number
              v-model="setupForm.detail"
              controls-position="right"
              size="small"
              :min="1"
              :max="10"
            >
            </el-input-number>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="积分：">
            <el-input-number
              v-model="setupForm.integral"
              controls-position="right"
              size="small"
              :min="1"
              :max="10"
            >
            </el-input-number>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="排序：">
            <el-input-number
              v-model="setupForm.sort"
              controls-position="right"
              size="small"
              :min="1"
              :max="10"
            >
            </el-input-number>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <div class="from-item-checkbox">
            <el-form-item label="单独设置：">
              <el-checkbox v-model="setupChecked01">佣金设置（数字即返佣金额）</el-checkbox>
            </el-form-item>
            <el-form-item label="付费会员价：">
              <el-checkbox v-model="setupChecked02">付费会员价</el-checkbox>
            </el-form-item>
          </div>
        </el-col>

        <el-col :span="8">
          <el-form-item label="商品状态：">
            <el-radio-group v-model="setupForm.is_show">
              <el-radio label="1">上架</el-radio>
              <el-radio label="0">下架</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="热卖单品：">
            <el-radio-group v-model="setupForm.is_hot">
              <el-radio label="1">开启</el-radio>
              <el-radio label="0">关闭</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="促销单品：">
            <el-radio-group v-model="setupForm.is_benefit">
              <el-radio label="1">开启</el-radio>
              <el-radio label="0">关闭</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>



        <el-col :span="8">
          <el-form-item label="精品推荐：">
            <el-radio-group v-model="setupForm.is_best">
              <el-radio label="1">上架</el-radio>
              <el-radio label="0">下架</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="首发新品：">
            <el-radio-group v-model="setupForm.is_new">
              <el-radio label="1">开启</el-radio>
              <el-radio label="0">关闭</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="优品推荐：">
            <el-radio-group v-model="setupForm.is_good">
              <el-radio label="1">开启</el-radio>
              <el-radio label="0">关闭</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="活动优先级：">
            <el-tag v-for="item in setupForm.activity" :key="item" :type="activity[item]" v-dragging="{item: item,list: setupForm.activity,group: 'color'}">{{item}}</el-tag>
            <!--<el-tag>秒杀</el-tag>
            <el-tag type="success">砍价</el-tag>
            <el-tag type="warning">拼团</el-tag>-->
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="赠送优惠券：">
            <el-button type="primary" size="small">主要按钮</el-button>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="赠送优惠券：">
            <el-input v-model="setupForm.coupon" placeholder="请输入商品名称" size="small"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item>
            <el-button>上一步</el-button>
            <el-button type="primary">保存</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>

<script>
  export default {
    name: "productSetup",
    data() {
      return {
        num: 0,
        checked: false,
        setupChecked01: true,
        setupChecked02: false,
        radio: 0,
        setupForm: {
          detail: "",
          integral: "",
          sort: "",
          is_show: "",
          is_hot: "",
          is_benefit: "",
          is_best: "",
          is_new: "",
          is_good: "",
          coupon: "",
          activity: ["默认", "秒杀", "砍价", "拼团"]
        },
        activity: {
          "默认": "danger",
          "秒杀": "primary",
          "砍价": "success",
          "拼团": "warning"
        },
        setupRules: {

        }
      };
    }
  }
</script>

<style lang="scss" scope>
  .product-setup {
    .el-input-number{
      width: auto;
    }
    .from-item-checkbox {
      margin-bottom: 24px;
    }
    .el-tag {
      margin-right: 10px;
    }
  }
</style>
